package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.dragon.mmochat.model.map.MmochatMap;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiProtocolMessage;

public class Mmochat_1_27S extends SkymobiProtocolMessage {
	private MmochatMap map;

	public Mmochat_1_27S() {
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_S_1_27);
	}

	@Override
	protected void encodeBody(SkymobiBuffer out) {
		out.putInt(map.getMapId());
		if (map.isHasWeather()) {
			out.put((byte) map.getCurWeather().getValue());
		} else {
			out.put((byte) 0);
		}
	}

	public void setMap(MmochatMap map) {
		this.map = map;
	}

}
